package com.xdtech.trans.vo;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import com.xdtech.core.model.BaseItem;
import com.xdtech.core.orm.utils.BeanUtils;
import com.xdtech.sys.util.SessionContextUtil;
import com.xdtech.sys.vo.UserItem;
import com.xdtech.trans.model.TransOrder;
import com.xdtech.trans.model.TransWebSite;
import com.xdtech.web.freemark.item.GridColumn;

/**
 * 
 * @author max.zheng
 * @create 2015-05-26 21:56:45
 * @since 1.0
 * @see
 */
public class TransOrderItem extends BaseItem implements Serializable{
	private static final long serialVersionUID = 1L;
	private Long id;
	@GridColumn(title="运单号",width=100)
	private String orderNo;
	@GridColumn(title="运单状态",width=100,dictionaryCode="ORDER_STATUS")
	private String orderStatus;
	@GridColumn(title="起始站",width=100)
	private String startWebsite;
	private Long startWebsiteId;
	@GridColumn(title="目的站",width=100)
	private String endWebsite;
	private Long endWebsiteId;
	@GridColumn(title="接单时间",width=100)
	private String receiveTime;
	@GridColumn(title="寄件单位",width=100)
	private String sendUnit;
	@GridColumn(title="寄件人",width=100)
	private String sender;
	@GridColumn(title="寄件人电话",width=100)
	private String sendPhone;
	@GridColumn(title="寄件地址",width=100)
	private String sendAddress;
	@GridColumn(title="收件单位",width=100)
	private String receiveUnit;
	@GridColumn(title="收件人",width=100)
	private String receiver;
	@GridColumn(title="收件人电话",width=100)
	private String receivePhone;
	@GridColumn(title="收件地址",width=100)
	private String receiveAddress;
	@GridColumn(title="货物名称",width=100)
	private String goodsName;
	@GridColumn(title="货物类型",width=100)
	private String goodsType;
	@GridColumn(title="件数",width=100)
	private Integer goodsNum;
	@GridColumn(title="重量KG",width=100)
	private Double weight;
	@GridColumn(title="体积",width=100)
	private Double volume;
	@GridColumn(title="运费",width=100)
	private Double freight;
	@GridColumn(title="保价金额",width=100)
	private Double supportSum;
	@GridColumn(title="保险费",width=100)
	private Double premium;
	@GridColumn(title="代收货款",width=100)
	private Double agencyFund;
	@GridColumn(title="代收手续费",width=100)
	private Double agencyHandSum;
	@GridColumn(title="到付手续费",width=100)
	private Double arrivalSum;
	@GridColumn(title="回单手续费",width=100)
	private Double receiveSum;
	@GridColumn(title="其它费用",width=100)
	private Double otherSum;
	@GridColumn(title="合计应收",width=100)
	private Double total;
	@GridColumn(title="收款网点",width=100)
	private String payWebsite;
	private Long payWebsiteId;
	@GridColumn(title="业务员",width=100)
	private String salesman;
	
	private String sendRegionAddr;
	private String receiveRegionAddr;
	
	private String creator;
	@GridColumn(title="是否到付",width=100,dictionaryCode="YON")
	private String arrivePay;
	
//	private String beginCreateTime;
//	
//	private String endCreateTime;
	
	private String currentSubWebsiteIds;
	//订单来源标记
	private String orderForm;
	
	
	public void setId(Long id) {
		this.id = id;
		addQuerys("id", id);
	}
	public Long getId() {
		return id;
	}
	
	public void setOrderNo(String orderNo) {
		this.orderNo = orderNo;
		addQuerys("orderNo", orderNo);
	}
	public String getOrderNo() {
		return orderNo;
	}
	
	public void setStartWebsite(String startWebsite) {
		this.startWebsite = startWebsite;
		addQuerys("startWebsite", startWebsite);
	}
	public String getStartWebsite() {
		return startWebsite;
	}
	
	public void setEndWebsite(String endWebsite) {
		this.endWebsite = endWebsite;
		addQuerys("endWebsite", endWebsite);
	}
	public String getEndWebsite() {
		return endWebsite;
	}
	
	public void setReceiveTime(String receiveTime) {
		this.receiveTime = receiveTime;
		addQuerys("receiveTime", receiveTime);
	}
	public String getReceiveTime() {
		return receiveTime;
	}
	
	public void setSendUnit(String sendUnit) {
		this.sendUnit = sendUnit;
		addQuerys("sendUnit", sendUnit);
	}
	public String getSendUnit() {
		return sendUnit;
	}
	
	public void setSender(String sender) {
		this.sender = sender;
		addQuerys("sender", sender);
	}
	public String getSender() {
		return sender;
	}
	
	public void setSendPhone(String sendPhone) {
		this.sendPhone = sendPhone;
		addQuerys("sendPhone", sendPhone);
	}
	public String getSendPhone() {
		return sendPhone;
	}
	
	public void setSendAddress(String sendAddress) {
		this.sendAddress = sendAddress;
		addQuerys("sendAddress", sendAddress);
	}
	public String getSendAddress() {
		return sendAddress;
	}
	
	public void setReceiveUnit(String receiveUnit) {
		this.receiveUnit = receiveUnit;
		addQuerys("receiveUnit", receiveUnit);
	}
	public String getReceiveUnit() {
		return receiveUnit;
	}
	
	public void setReceiver(String receiver) {
		this.receiver = receiver;
		addQuerys("receiver", receiver);
	}
	public String getReceiver() {
		return receiver;
	}
	
	public void setReceivePhone(String receivePhone) {
		this.receivePhone = receivePhone;
		addQuerys("receivePhone", receivePhone);
	}
	public String getReceivePhone() {
		return receivePhone;
	}
	
	public void setReceiveAddress(String receiveAddress) {
		this.receiveAddress = receiveAddress;
		addQuerys("receiveAddress", receiveAddress);
	}
	public String getReceiveAddress() {
		return receiveAddress;
	}
	
	public void setGoodsName(String goodsName) {
		this.goodsName = goodsName;
		addQuerys("goodsName", goodsName);
	}
	public String getGoodsName() {
		return goodsName;
	}
	
	public void setGoodsType(String goodsType) {
		this.goodsType = goodsType;
		addQuerys("goodsType", goodsType);
	}
	public String getGoodsType() {
		return goodsType;
	}
	
	public void setGoodsNum(Integer goodsNum) {
		this.goodsNum = goodsNum;
		addQuerys("goodsNum", goodsNum);
	}
	public Integer getGoodsNum() {
		return goodsNum;
	}
	
	public void setWeight(Double weight) {
		this.weight = weight;
		addQuerys("weight", weight);
	}
	public Double getWeight() {
		return weight;
	}
	
	public void setVolume(Double volume) {
		this.volume = volume;
		addQuerys("volume", volume);
	}
	public Double getVolume() {
		return volume;
	}
	
	public void setFreight(Double freight) {
		this.freight = freight;
		addQuerys("freight", freight);
	}
	public Double getFreight() {
		return freight;
	}
	
	public void setSupportSum(Double supportSum) {
		this.supportSum = supportSum;
		addQuerys("supportSum", supportSum);
	}
	public Double getSupportSum() {
		return supportSum;
	}
	
	public void setPremium(Double premium) {
		this.premium = premium;
		addQuerys("premium", premium);
	}
	public Double getPremium() {
		return premium;
	}
	
	public void setAgencyFund(Double agencyFund) {
		this.agencyFund = agencyFund;
		addQuerys("agencyFund", agencyFund);
	}
	public Double getAgencyFund() {
		return agencyFund;
	}
	
	public void setAgencyHandSum(Double agencyHandSum) {
		this.agencyHandSum = agencyHandSum;
		addQuerys("agencyHandSum", agencyHandSum);
	}
	public Double getAgencyHandSum() {
		return agencyHandSum;
	}
	
	public void setArrivalSum(Double arrivalSum) {
		this.arrivalSum = arrivalSum;
		addQuerys("arrivalSum", arrivalSum);
	}
	public Double getArrivalSum() {
		return arrivalSum;
	}
	
	public void setReceiveSum(Double receiveSum) {
		this.receiveSum = receiveSum;
		addQuerys("receiveSum", receiveSum);
	}
	public Double getReceiveSum() {
		return receiveSum;
	}
	
	public void setOtherSum(Double otherSum) {
		this.otherSum = otherSum;
		addQuerys("otherSum", otherSum);
	}
	public Double getOtherSum() {
		return otherSum;
	}
	
	public void setTotal(Double total) {
		this.total = total;
		addQuerys("total", total);
	}
	public Double getTotal() {
		return total;
	}
	
	public void setPayWebsite(String payWebsite) {
		this.payWebsite = payWebsite;
		addQuerys("payWebsite", payWebsite);
	}
	public String getPayWebsite() {
		return payWebsite;
	}
	
	public void setSalesman(String salesman) {
		this.salesman = salesman;
		addQuerys("salesman", salesman);
	}
	public String getSalesman() {
		return salesman;
	}
	
	public Long getStartWebsiteId()
	{
		return startWebsiteId;
	}
	public void setStartWebsiteId(Long startWebsiteId)
	{
		this.startWebsiteId = startWebsiteId;
		addQuerys("startWebsiteId", startWebsiteId+"");
	}
	public Long getEndWebsiteId()
	{
		return endWebsiteId;
	}
	public void setEndWebsiteId(Long endWebsiteId)
	{
		this.endWebsiteId = endWebsiteId;
		addQuerys("endWebsiteId", endWebsiteId+"");
	}
	public Long getPayWebsiteId()
	{
		return payWebsiteId;
	}
	public void setPayWebsiteId(Long payWebsiteId)
	{
		this.payWebsiteId = payWebsiteId;
		addQuerys("payWebsiteId", payWebsiteId+"");
	}
	public String getOrderStatus()
	{
		return orderStatus;
	}
	public void setOrderStatus(String orderStatus)
	{
		this.orderStatus = orderStatus;
		addQuerys("orderStatus", orderStatus);
	}
	public String getSendRegionAddr()
	{
		return sendRegionAddr;
	}
	public void setSendRegionAddr(String sendRegionAddr)
	{
		this.sendRegionAddr = sendRegionAddr;
		this.sendAddress = (sendRegionAddr+sendAddress);
	}
	public String getReceiveRegionAddr()
	{
		return receiveRegionAddr;
	}
	public void setReceiveRegionAddr(String receiveRegionAddr)
	{
		this.receiveRegionAddr = receiveRegionAddr;
		this.receiveAddress = (receiveRegionAddr+receiveAddress);
	}
	public String getCreator() {
		return creator;
	}
	public void setCreator(String creator) {
		this.creator = creator;
		addQuerys("creator", creator);
	}
	
	public String getArrivePay() {
		return arrivePay;
	}
	public void setArrivePay(String arrivePay) {
		this.arrivePay = arrivePay;
	}
	
	public String getCurrentSubWebsiteIds() {
		return currentSubWebsiteIds;
	}
	public void setCurrentSubWebsiteIds(String currentSubWebsiteIds) {
		this.currentSubWebsiteIds = currentSubWebsiteIds;
		addQuerys("currentSubWebsiteIds", currentSubWebsiteIds);
	}
	public String getOrderForm() {
		return orderForm;
	}
	public void setOrderForm(String orderForm) {
		this.orderForm = orderForm;
	}
	//	public String getBeginCreateTime() {
//		return beginCreateTime;
//	}
//	public void setBeginCreateTime(String beginCreateTime) {
//		this.beginCreateTime = beginCreateTime;
//		addQuerys("beginCreateTime", beginCreateTime);
//	}
//	public String getEndCreateTime() {
//		return endCreateTime;
//	}
//	public void setEndCreateTime(String endCreateTime) {
//		this.endCreateTime = endCreateTime;
//		addQuerys("endCreateTime", endCreateTime);
//	}
	/**
	 * 根据model构建vo
	 * 
	 * @author max
	 * @return
	 */
	public static TransOrderItem createItem(TransOrder transOrder) {
		TransOrderItem transOrderItem = new TransOrderItem();
		BeanUtils.copyProperties(transOrderItem, transOrder);
		//自定义属性设置填充
//		TransWebSite startWebSite = transOrder.getStartWebSite();
//		if (startWebSite!=null) {
//			transOrderItem.setStartWebsite(startWebSite.getName());
//			transOrderItem.setStartWebsiteId(startWebSite.getId());
//		}
//		TransWebSite endWebSite = transOrder.getEndWebsite();
//		if (startWebSite!=null) {
//			transOrderItem.setEndWebsite(endWebSite.getName());
//			transOrderItem.setEndWebsiteId(endWebSite.getId());
//		}
		return transOrderItem;
	}
	/**
	 * 根据model集合创建vo集合
	 * 
	 * @author max
	 * @return
	 */
	public static List<TransOrderItem> createItems(List<TransOrder> transOrders) {
		List<TransOrderItem> transOrderItems = new ArrayList<TransOrderItem>();
		for (TransOrder transOrder : transOrders) {
			transOrderItems.add(createItem(transOrder));
		}
		return transOrderItems;
	}
	
	public static void main(String[] args) {
		System.out.println(new TransOrderItem().createItem(new TransOrder()));
	}
}
